'use strict';
const crypto = require('crypto')
module.exports = app => {
  const { STRING, INTEGER, DATE, ENUM } = app.Sequelize;
  // 配置（重要：一定要配置详细，一定要！！！）
  const City = app.model.define('city', {
    id: {
      type: INTEGER(30).UNSIGNED,
      primaryKey: true,
      autoIncrement: true
    },
    name: {
      type: STRING(200),
      allowNull: false,
      defaultValue: '',
      comment: '城市名称',
    },
    sort: {
      type: INTEGER(30),
      allowNull: false,
      defaultValue: '1',
      comment: '排序 越小越前',
    },
    operation: {
      type: STRING(20),
      allowNull: false,
      defaultValue: '0',
      comment: '操作者',
    },
    status: {
      type: ENUM,
      values: ['0', '1',],
      allowNull: false,
      defaultValue: '1',
      comment: '状态 0禁用 1启用 '
    },
    created_at: DATE,
    updated_at: DATE,
  });
  return City;
};